import { network } from '@/utils';
import {
  DetailParams,
  SigningStationListParams,
} from './data.d';

import { partner } from '../../../../../config/Apis';

export async function queryPosthouseContractDetail(params: DetailParams) {
  params._content_type = 'json';
  return network.get(partner.contract_posthouse_detail, { params });
}

export async function queryFranchiseeList(params: any) {
  params._content_type = 'json';
  return network.get(partner.franchisee_list, { params });
}

export async function queryContractPartyList() {
  return network.get(partner.common_org_list);
}

export async function savePosthouseContract(params: any) {
  return network.post(params.contract_id
    ? partner.contract_posthouse_update
    : partner.contract_posthouse_save, {
    params,
  });
}

export async function queryPosthouseList(params: any) {
  params._content_type = 'json';
  return network.get(partner.contract_posthouse_search_by_name, { params });
}

export async function queryGenerateNum(params: SigningStationListParams) {
  params._content_type = 'json';
  return network.get(partner.contract_posthouse_add, { params });
}
